package com.gthncz.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class GuitaiA implements InvocationHandler {

    private Object object;

    public GuitaiA(Object object){
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("proxy object: " + proxy.getClass().getSimpleName());
        System.out.println("method name: " + method.getName());

        System.out.println("开始, 销售的柜台是: " + proxy.getClass().getSimpleName());
        method.invoke(object, args);
        System.out.println("结束.");
        return null;
    }
}
